3.26 \(\int \sin ^2(\frac{1}{4}+x+x^2) \, dx\)

Optimal. Leaf size=27 \[ \frac{x}{2}-\frac{1}{4} \sqrt{\pi } \text{FresnelC}\left (\frac{2 x+1}{\sqrt{\pi }}\right ) \]

[Out]

x/2 - (Sqrt[Pi]*FresnelC[(1 + 2*x)/Sqrt[Pi]])/4

________________________________________________________________________________________

Rubi [A]  time = 0.0146485, antiderivative size = 27, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.273, Rules used = {3449, 3446, 3352} \[ \frac{x}{2}-\frac{1}{4} \sqrt{\pi } \text{FresnelC}\left (\frac{2 x+1}{\sqrt{\pi }}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Sin[1/4 + x + x^2]^2,x]

[Out]

x/2 - (Sqrt[Pi]*FresnelC[(1 + 2*x)/Sqrt[Pi]])/4

Rule 3449

Int[Sin[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]^(n_), x_Symbol] :> Int[ExpandTrigReduce[Sin[a + b*x + c*x^2]^n, x],
 x] /; FreeQ[{a, b, c}, x] && IGtQ[n, 1]

Rule 3446

Int[Cos[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Int[Cos[(b + 2*c*x)^2/(4*c)], x] /; FreeQ[{a, b, c},
x] && EqQ[b^2 - 4*a*c, 0]

Rule 3352

Int[Cos[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]*FresnelC[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)])/
(f*Rt[d, 2]), x] /; FreeQ[{d, e, f}, x]

Rubi steps

\begin{align*} \int \sin ^2\left (\frac{1}{4}+x+x^2\right ) \, dx &=\int \left (\frac{1}{2}-\frac{1}{2} \cos \left (\frac{1}{2}+2 x+2 x^2\right )\right ) \, dx\\ &=\frac{x}{2}-\frac{1}{2} \int \cos \left (\frac{1}{2}+2 x+2 x^2\right ) \, dx\\ &=\frac{x}{2}-\frac{1}{2} \int \cos \left (\frac{1}{8} (2+4 x)^2\right ) \, dx\\ &=\frac{x}{2}-\frac{1}{4} \sqrt{\pi } C\left (\frac{1+2 x}{\sqrt{\pi }}\right )\\ \end{align*}

Mathematica [A]  time = 0.0125249, size = 27, normalized size = 1. \[ \frac{1}{4} \left (2 x-\sqrt{\pi } \text{FresnelC}\left (\frac{2 x+1}{\sqrt{\pi }}\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[1/4 + x + x^2]^2,x]

[Out]

(2*x - Sqrt[Pi]*FresnelC[(1 + 2*x)/Sqrt[Pi]])/4

________________________________________________________________________________________

Maple [A]  time = 0.013, size = 20, normalized size = 0.7 \begin{align*}{\frac{x}{2}}-{\frac{\sqrt{\pi }}{4}{\it FresnelC} \left ({\frac{1+2\,x}{\sqrt{\pi }}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(1/4+x+x^2)^2,x)

[Out]

1/2*x-1/4*FresnelC((1+2*x)/Pi^(1/2))*Pi^(1/2)

________________________________________________________________________________________

Maxima [C]  time = 1.73747, size = 46, normalized size = 1.7 \begin{align*} \frac{1}{16} \, \sqrt{\pi }{\left (\left (i - 1\right ) \, \operatorname{erf}\left (\frac{2 i \, x + i}{\sqrt{2 i}}\right ) + \left (i + 1\right ) \, \operatorname{erf}\left (\frac{2 i \, x + i}{\sqrt{-2 i}}\right )\right )} + \frac{1}{2} \, x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(1/4+x+x^2)^2,x, algorithm="maxima")

[Out]

1/16*sqrt(pi)*((I - 1)*erf((2*I*x + I)/sqrt(2*I)) + (I + 1)*erf((2*I*x + I)/sqrt(-2*I))) + 1/2*x

________________________________________________________________________________________

Fricas [A]  time = 1.68478, size = 74, normalized size = 2.74 \begin{align*} -\frac{1}{4} \, \sqrt{\pi } \operatorname{C}\left (\frac{2 \, x + 1}{\sqrt{\pi }}\right ) + \frac{1}{2} \, x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(1/4+x+x^2)^2,x, algorithm="fricas")

[Out]

-1/4*sqrt(pi)*fresnel_cos((2*x + 1)/sqrt(pi)) + 1/2*x

________________________________________________________________________________________

Sympy [A]  time = 0.887441, size = 22, normalized size = 0.81 \begin{align*} \frac{x}{2} - \frac{\sqrt{\pi } C\left (\frac{4 x + 2}{2 \sqrt{\pi }}\right )}{4} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(1/4+x+x**2)**2,x)

[Out]

x/2 - sqrt(pi)*fresnelc((4*x + 2)/(2*sqrt(pi)))/4

________________________________________________________________________________________

Giac [C]  time = 1.28109, size = 35, normalized size = 1.3 \begin{align*} \left (\frac{1}{16} i + \frac{1}{16}\right ) \, \sqrt{\pi } \operatorname{erf}\left (\left (i - 1\right ) \, x + \frac{1}{2} i - \frac{1}{2}\right ) - \left (\frac{1}{16} i - \frac{1}{16}\right ) \, \sqrt{\pi } \operatorname{erf}\left (-\left (i + 1\right ) \, x - \frac{1}{2} i - \frac{1}{2}\right ) + \frac{1}{2} \, x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(1/4+x+x^2)^2,x, algorithm="giac")

[Out]

(1/16*I + 1/16)*sqrt(pi)*erf((I - 1)*x + 1/2*I - 1/2) - (1/16*I - 1/16)*sqrt(pi)*erf(-(I + 1)*x - 1/2*I - 1/2)
 + 1/2*x